﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using iTFF.WPF.Model.Toaster;
using System.Windows.Media;
using System.Windows.Input;

namespace iTFF.WPF.ViewModel
{
    class ToasterSkinViewModel : ViewModelBase
    {

        #region Fields

        ToasterSkin _skin;

        #endregion

        #region constructor

        public ToasterSkinViewModel(ToasterSkin skin)
        {
            _skin = skin;
        }

        #endregion

        #region Properties

        public ToasterSkin Skin
        {
            get { return _skin; }
        }

        public string Name
        { 
            get { return _skin.Name; } 
        }

        public string FullName
        {
            get { return _skin.FullName; }
        }

        public string Description
        {
            get { return _skin.Description; }
        }

        public bool IsGlassEffectEnabled
        {
            get { return _skin.IsGlassEffectEnabled; }
        }

        public Color ForegroundColor
        {
            get { return _skin.ForegroundColor; }
            set
            {
                if (value != _skin.ForegroundColor)
                {
                    _skin.ForegroundColor = value;
                    OnPropertyChanged("ForegroundColor");
                    OnPropertyChanged("ForegroundBrush");
                }
            }
        }

        #endregion

        #region Presenation properties

        public SolidColorBrush ForegroundBrush
        {
            get
            {
                if (_skin.ForegroundColor != null)
                    return new SolidColorBrush(_skin.ForegroundColor);
                else
                    return null;
            }
        }

        #endregion
    }
}
